<?php
$first = getvar( "name" );
$prev_account = "a";
$url = "select mid(account,2,1) as a from k_user where acl=3 and account like '".substr( $first, 0, 1 )."%' order by a desc";
$rs = getdb( $url );
if ( $rs->f[0] != "" )
{
    $tmp = ord( $rs->f[0] );
    if ( ord( "a" ) <= $tmp && $tmp < ord( "z" ) )
    {
        $prev_account = chr( ord( $rs->f[0] ) + 1 );
    }
}
echo "<script>";
echo "parent.document.all.account.value = \"".substr( $first, 0, 1 ).$prev_account."\";";
echo "</script>";
?>